package hu.rsc.forbiddenwords.server.persistent;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

@PersistenceCapable
public class Application {
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key key;

    @Persistent
    private String name;

    @Persistent
    private String language;

    @Persistent
    private String userinfo;

    @Persistent
    private boolean opened = false;

    // Accessors for the fields. JDO doesn't use these, but your application does.

    public Application(String userinfo, String name, String language) {
	super();
	this.userinfo = userinfo;
	this.name = name;
	this.language = language;
    }

    public Key getKey() {
	return this.key;
    }

    public String getLanguage() {
	return this.language;
    }

    public String getName() {
	return this.name;
    }

    public String getUserinfo() {
	return this.userinfo;
    }

    public boolean isOpened() {
	return this.opened;
    }

    public void setKey(Key key) {
	this.key = key;
    }

    public void setLanguage(String language) {
	this.language = language;
    }

    public void setName(String name) {
	this.name = name;
    }

    public void setOpened(boolean opened) {
	this.opened = opened;
    }

    public void setUserinfo(String userinfo) {
	this.userinfo = userinfo;
    }

    @Override
    public String toString() {
	return "Application [name=" + this.name + "]";
    }

}